package internal_test

import (
	"slices"
	"testing"

	"gitcode.com/lin-xii/algorithm-and-structure/internal"
)

func TestSelectionSort(t *testing.T) {
	list := []int{1, 3, 5, 7, 2, 4, 6, 8}
	target := []int{8, 7, 6, 5, 4, 3, 2, 1}
	result := internal.SelectionSort(list)
	if !slices.Equal(result, target) {
		t.Errorf("expect list %+v, got %+v", target, result)
	}
}
